package Graph;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;

import java.util.LinkedList;

@Slf4j
public class GraphTest {
    private Graph graph = new Graph();

    @Test
    public void test(){
        Vertex a = new Vertex("a");
        Vertex b = new Vertex("b");
        Vertex c = new Vertex("c");
        Vertex d = new Vertex("d");
        Vertex e = new Vertex("e");
        Vertex f = new Vertex("f");
        Vertex g = new Vertex("g");
        Vertex h = new Vertex("h");
        Vertex i = new Vertex("i");
        Vertex j = new Vertex("j");
        Vertex k = new Vertex("k");
        graph.buildDoubleEdge(new Edge(a,b));
        graph.buildSingleEdge(new Edge(a,d));
        graph.buildSingleEdge(new Edge(a,f));
        graph.buildSingleEdge(new Edge(a,k));
        graph.buildSingleEdge(new Edge(b,c));
        graph.buildSingleEdge(new Edge(d,e));
        graph.buildSingleEdge(new Edge(f,g));
        graph.buildSingleEdge(new Edge(k,j));
        graph.buildSingleEdge(new Edge(c,i));
        graph.buildSingleEdge(new Edge(e,h));
        graph.buildSingleEdge(new Edge(g,j));
        graph.buildSingleEdge(new Edge(i,h));
        graph.buildSingleEdge(new Edge(j,h));
        //graph.printGraph();
        log.info("{}",graph.hasCycle());
        LinkedList<Edge> edges = graph.pathPlanning(a, i, false);
        for (Edge edge : edges) {
            System.out.println(edge);
        }
    }
}
